package cn.web.tunnelrobot.controller;

import cn.web.tunnelrobot.StartService;
import cn.web.tunnelrobot.dto.Warning;
import cn.web.tunnelrobot.util.Constants;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @createDate: 2021-6-23
 * @version: 1.0
 */
@RestController
@RequestMapping("/testController")
public class TestController {
    @GetMapping("/timer")
    @ResponseBody
    public void timer(){
        StartService.timer();
    }
    @GetMapping("/addWarning")
    @ResponseBody
    public void addTm(){
        Warning warning = new Warning();
        warning.setId(22);
        warning.setCode(11);
        warning.setLevel("Ⅰ");
        warning.setMsg("未戴安全头盔检测");
        warning.setUrl("http://tunnelrobot.natapp1.cc/jpgs/5017/1/2021/7/1/15/637607517624559501_0.jpg");
        Constants.warningList.add(warning);
    }
}
